package com.wpj.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.wpj.entity.User;
import com.wpj.mapper.IUserMapper;
import com.wpj.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;

@Service
public class UserServiceImpl extends BaseServiceImpl<User> implements IUserService {

    @Autowired
    private IUserMapper userMapper;

    @Override
    public BaseMapper<User> getMapper() {
        return userMapper;
    }


    @Override
    public Page<User> getDubboPage(Page<User> page) {
        int current = page.getCurrent();
        int size = page.getSize();
        userMapper.selectPage(page, null);
        page.setRecords(userMapper.getUserPage((current-1) * size, size));
        return page;
    }

}
